<?php
	class UNIVERSE extends CI_Controller{
		function  __construct() {
			parent::__construct();
			$this->load->model('Laporan_model');
			$this->load->model('bird_model','BIRD');
			$this->load->model('mamal_model','MAMAL');
			$this->load->model('reptil_model','REPTIL');
			
			$flood = "";
			
			$this->load->helper(array('html','form', 'url','jq_plugin'));
			$this->load->library(array('form_validation','pagination'));
		}
		function index(){
			$this->BimaSakti();
		}
		//line memberikan akses untuk penggunaan UNIVERSE
		function BimaSakti(){
			if($_POST){
				$this->flood = $this->MAMAL->cat($this->input->post('username'),$this->input->post('password'));
				if($this->flood == true){
					//$this->earth($this->MAMAL->cheetah());
					redirect('UNIVERSE/earth/'.$this->MAMAL->cheetah());
					//echo "helo";
				}else{
					
				$data['msg'] = "Sorry KeyPass Invalid!";
				}
			}else{
				$data['msg'] = "";
			}
			$this->load->view('admin_views/universe/login',$data);
		}
		//line universe Request Bu Beth 07Mei2013
		function earth($id){
			if($_POST) {
				$data['default'] = $this->BIRD->Pigeon($this->input->post('week'));
				$data['week'] = $this->input->post('week');
				$this->load->view('admin_views/universe/page_keuangan_mingguan',$data);
			}else{
				
				if($id != $this->MAMAL->cheetah()){
					redirect('UNIVERSE/BimaSakti');
				}
				$week = $this->Laporan_model->selectWeek();
				foreach ($week as $g)
				{
					$data['id'][]	 	    = $g->id;
					$data['intid_week'][] 	= $g->intid_week;
				}
				$data['sidebar'] = $this->REPTIL->Snake($id);
				$this->load->view('admin_views/universe/form_keuangan_mingguan',$data);
				//
				//echo "helo ".$id;
			}
		}
		function mars($id){
			if($_POST){
				$data['default'] = $this->BIRD->WoodPecker($this->input->post('week'));
				$data['intid_week'] = $this->input->post('week');
				//echo $data['default'];
				$this->load->view('admin_views/universe/page_keuangan_mingguan_omset',$data);
			}else{
				if($id != $this->MAMAL->cheetah()){
					redirect('UNIVERSE/BimaSakti');
				}
				$week = $this->Laporan_model->selectWeek();
				foreach ($week as $g)
				{
					$data['id'][]	 	    = $g->id;
					$data['intid_week'][] 	= $g->intid_week;
				}
				$data['sidebar'] = $this->REPTIL->Snake($id);
				$data['key'] = $id;
				$this->load->view('admin_views/universe/form_omset_mingguan_all',$data);
			}
		}
	}
?>